xen/arm: Extend copy_to_guest to support copying from guest VA and use it
authorJulien Grall <julien.grall@linaro.org>
Tue, 12 Dec 2017 19:01:59 +0000 (19:01 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 12 Dec 2017 19:52:33 +0000 (11:52 -0800)
commitb324c511906694ee27f7f06bfe99f343e8509f64
tree49248ad65220668c4deafaf3597a90ff97b8254a
parent466473a53e7c5c1dd38834faa54a960dc861a7cf
xen/arm: Extend copy_to_guest to support copying from guest VA and use it

The only differences between copy_to_guest (formerly called
raw_copy_to_guest_helper) and raw_copy_from_guest is:
    - The direction of the memcpy
    - The permission use for translating the address

Extend copy_to_guest to support copying from guest VA by adding using a
bit in the flags to tell the direction of the copy.

Lastly, reimplement raw_copy_from_guest using copy_to_guest.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/guestcopy.c